<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用 ElementUI</title>
    <!-- CDN 引入 ElementUI 样式表 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>

<body>
    <div id="app">
        <!-- el-xxxx 就是 ElementUI 组件名称 -->
        <el-button @click="handleClick" type="primary">{{ message }}</el-button>
        <div>
            <!-- ElementUI 依赖 vue，所以必须优先导入 vue -->

            <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
            <!-- 再导入 ElementUI 库 -->

            <script src="https://unpkg.com/element-ui/lib/index.js"></script>

            <script>
                new Vue({
                    el: '#app',
                    data: {
                        message: 'ElementUI 按钮'

                    },
                    methods: {
                        handleClick() {
                            alert('按钮被点击');
                        }
                    }
                });
            </script>
</body>


</html>